package com.example.hotelback.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private String password;
    @TableField("isRoot")
    private Integer isRoot;
    private String telephone;
    private String gender;
    private String identity;
    @TableField("isDelete")
    private Integer isDelete;
    @TableField(exist = false)
    private String token;

    public User(User tempUser) {
        this.name = tempUser.getName();
        this.password = tempUser.getPassword();
        this.telephone = tempUser.getTelephone();
        this.gender = tempUser.getGender();
        this.identity = tempUser.getIdentity();
    }
}
